package ProjektTest;

import java.awt.Color;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Calendar;

import org.junit.Test;

import Projekt.OrganizerEventICS;
import Tydzien10.OrganizerEvent;

public class OrganizerEventICSTest {

	@Test
	public void test() throws UnsupportedEncodingException, FileNotFoundException, IOException {
		ArrayList<OrganizerEvent> events = new ArrayList<OrganizerEvent>();
		events.add(new OrganizerEvent(Calendar.getInstance(), Calendar.getInstance(), "aaa", Color.BLACK));
		events.add(new OrganizerEvent(Calendar.getInstance(), Calendar.getInstance(), "bbb", Color.BLUE));
		OrganizerEventICS.exportToICS(new File("aaa.ics"), events, 10);
		ArrayList<OrganizerEvent> loaded = OrganizerEventICS.importFromICS(new File("aaa.ics"));
		for(OrganizerEvent event : loaded)
		{
			System.out.println(event);
		}
	}

}
